<form [formGroup]="form" class="great-form">
  <div class="great-form-group">
    <label>任意整数:</label>
    <div class="great-input">
      <input type="text" formControlName="integer" class="input"><span [innerHtml]="'this.validator.integer()'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer').dirty && form.get('integer').errors">只能输入整数！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>最小为18:</label>
    <div class="great-input">
      <input type="text" formControlName="integer2" class="input"><span [innerHtml]="'this.validator.integer({min: 18})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer2').dirty && form.get('integer2').errors">不能小于18！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>最大为18:</label>
    <div class="great-input">
      <input type="text" formControlName="integer3" class="input"><span [innerHtml]="'this.validator.integer({max: 18})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer3').dirty && form.get('integer3').errors">不能大于18！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>大于18:</label>
    <div class="great-input">
      <input type="text" formControlName="integer4" class="input"><span [innerHtml]="'this.validator.integer({greaterThan: 18})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer4').dirty && form.get('integer4').errors">大于18！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>小于18:</label>
    <div class="great-input">
      <input type="text" formControlName="integer5" class="input"><span [innerHtml]="'this.validator.integer({lessThan: 18})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer5').dirty && form.get('integer5').errors">小于18！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>必须输入两位:</label>
    <div class="great-input">
      <input type="text" formControlName="integer6" class="input"><span [innerHtml]="'this.validator.integer({length: 2})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer6').dirty && form.get('integer6').errors">必须输入两位的整数！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>至多输入两位:</label>
    <div class="great-input">
      <input type="text" formControlName="integer7" class="input"><span [innerHtml]="'this.validator.integer({maxLength: 2})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer7').dirty && form.get('integer7').errors">至多输入两位！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>至少输入两位:</label>
    <div class="great-input">
      <input type="text" formControlName="integer8" class="input"><span [innerHtml]="'this.validator.integer({minLength: 2})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer8').dirty && form.get('integer8').errors">至少输入两位！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>必须大于8小于18:</label>
    <div class="great-input">
      <input type="text" formControlName="integer9" class="input"><span [innerHtml]="'this.validator.integer({lessThan: 18, greaterThan: 8})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer9').dirty && form.get('integer9').errors">必须大于8小于18！</div>
    </div>
  </div>
  <div class="great-form-group">
    <label>必须大于等于8小于等于18:</label>
    <div class="great-input">
      <input type="text" formControlName="integer10" class="input"><span [innerHtml]="'this.validator.integer({max: 18, min: 8})'"></span>
      <div class="great-form-error-text" *ngIf="form.get('integer10').dirty && form.get('integer10').errors">必须大于等于8小于等于18！</div>
    </div>
  </div>
</form>
